sequenceLength = 3000000;
alpha = 0.01
x = runif(sequenceLength, 0, 100)
print(system.time(sort(x)))

L=8
K=5
alpha = K/100
sampleSize = L*40;
time1 = time2 = numeric(sampleSize); # Declare an array
for(i in 1:sampleSize){
  x = runif(sequenceLength, 0, 100); # Generate the sequence to be sorted
  # Measure sort times. The user-space time is at system.time(...)[1]
  # Inside system.time we must use x1 <- value and not x = value. The latter syntax is reserved for parameters.
  time1[i] = system.time(x1 <- sort(x, method = "quick"),  gcFirst = TRUE)[1];
  time2[i] = system.time(x2 <- sort(x, method = "shell"), gcFirst = TRUE)[1];
}

t.test(x=time1,y=time2,alternative='less',paired=TRUE,var.equal=FALSE,conf.level=1-alpha)